<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jsp/common/importHead.jsp"%>
<%@ include file="/WEB-INF/jsp/common/importCommonCss.jsp"%>
<style type="text/css">
  * html {
    background-color: #fff;
    min-height: 432px;
    height: calc(100% - 1px);
    overflow: auto;
  }
  html {
    height: 100%;
    min-height: 432px;
    height: calc(100% - 1px);
    overflow: auto;
  }
  body {
   background: #fff url(${basePath}/images/body.jpg) repeat-x;
   height: 100%;
  }

  .form-signin {
    max-width: 400px;
    _width:400px;
    padding: 19px 29px 29px;
    margin: 0 auto 20px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    -webkit-border-radius: 5px;
       -moz-border-radius: 5px;
            border-radius: 5px;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
       -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
            box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  .form-signin .form-signin-heading,
  .form-signin .checkbox {
    margin-bottom: 10px;
  }
  .form-signin input[type="text"],
  .form-signin input[type="password"] {
    font-size: 16px;
    height: auto;
    margin-bottom: 15px;
    padding: 7px 9px;
  }
.logo{height:80px;text-align:left;padding:20px 0 0 25px;zoom:1;position:relative;float:left;overflow:hidden;}
.logo_img{text-align:left;float:left;}
.gwlogo{width:100%;height:50px;position:absolute;top:20px;left:25px;z-index:9999;float:left;}
.gwlogo a,.gwlogo img{width:100%;height:50px;display:block;}
.sflogo{width:100%;height:30px;position:absolute;top:70px;left:25px;z-index:9999;float:left;}
.sflogo a,.sflogo img{width:100%;height:30px;display:block;}
</style>
</head>
<body>
	<div class="container" style="background-color: #FFF;border-left: 1px solid #93d3d8;border-right: 1px solid #93d3d8;border-bottom: 1px solid #93d3d8;height: 100%;">
	<div style="background: #fff url(${basePath}/images/header_ws1.jpg) no-repeat right top; width: 100%; height: 110px; text-align: right;
				overflow: hidden;margin-bottom: 20px;">
		<div class="logo">
		<div class="logo_img">
				<img src="${basePath }/images/logo.png" border="0">
		</div>
			<div class="gwlogo"><a target="_blank" href="http://www.sgcc.com.cn"><img src="${basePath }/images/blank.gif"></a></div>
			<div class="sflogo"><a target="_blank" href="http://www.tj.sgcc.com.cn"><img src="${basePath }/images/blank.gif"></a></div>
		</div>
	</div>
	
      <form class="form-signin" id="loginForm" action="${basePath }/user/login/" method="post">
        <h2 class="form-signin-heading">登录网站管理后台</h2>
		<p>请输入用户名和密码后点击登录:</p>
		<div class="alert alert-error" style="display: none;">
		  <button type="button" class="close" data-dismiss="alert">×</button>
		  <strong>用户名密码有误!</strong>请输入正确的用户名密码。
		</div>
		<div class="alert alert-warn" style="display: none;">
		  <strong>用户名密码</strong> 不能为空!
		</div>
        <input type="text" class="input-block-level" id="form-username" placeholder="账 号">
        <input type="password" class="input-block-level" id="form-password" name="password" placeholder="密 码">
        <button class="btn btn-large btn-success" type="submit">登录</button>
      </form>

    </div>
	<%@ include file="/WEB-INF/jsp/common/importCommonJs.jsp"%>
	<script>
	jQuery(document).ready(function() {
		var $loginForm = $('#loginForm');
		var $field = $loginForm.find('input[type="text"], input[type="password"], textarea');
	    
		var loginError = '${loginError}';
	    
	    if(loginError === true || loginError === 'true'){
	    	$(".alert-error").show(500);
	    }
	    else{
	    	$(".alert-error").hide(500);
	    }
	    
	    $field.each(function(){
	    	$(this).bind('keyup',function(){
	    		$(".alert-error,.alert-warn").hide(500);
	    	});
	    	
	    	$(this).bind('focus',function(){
	    		$(".alert-error,.alert-warn").hide(500);
	    	});
	    });
	    
	    $loginForm.on('submit', function(e) {
	    	var username = $("#form-username").val();
	    	var password = $("#form-password").val();
	    	if(username.replace(/^\s+|\s+$/gm,'').length == 0 || password.replace(/^\s+|\s+$/gm,'').length == 0){
	    		$(".alert-warn").show(500);
	    		setTimeout(function(){
	    			$(".alert-warn").hide(500);
	    		},2000);
	    		console.warn("用户名或者密码为空");
	    		return false;
	    	}
    		$loginForm.attr("action",$loginForm.attr("action") + username);
	    });
	});
	</script>
</body>
</html>